package nosql.util;

public class QueryHistoryRecord {
	private String firstComponent;
	private String secondComponent;
	private Integer type;
	
	public QueryHistoryRecord(String first, String second, Integer t){
		firstComponent = first;
		secondComponent = second;
		type = t;
	}
	
	public boolean equals(Object o){
		if(o instanceof QueryHistoryRecord){
			QueryHistoryRecord record = (QueryHistoryRecord)o;
			if(record.firstComponent.equals(firstComponent) && record.secondComponent.equals(secondComponent) && record.type.equals(type)){
				return true;
			}
		}
		return false;
	}
	
	public int hashCode(){
		return firstComponent.hashCode() + 8 * secondComponent.hashCode() + 64 * type;
	}
	
	public String getFirst(){
		return firstComponent;
	}
	
	public String getSecond(){
		return secondComponent;
	}
	
	public int getType(){
		return type;
	}
}
